package com.sims.action.attendanceRecord;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.sims.bean.Student;
import com.sims.beanEnhanced.StudentAttendanceRecord;
import com.sims.service.AttendanceRecordService;
import com.sims.util.ActionEnhanced;
import com.sims.util.Constant;

@SuppressWarnings("serial")
public class FindAttendanceRecordAction extends ActionEnhanced{

	private Student student;
	private List<StudentAttendanceRecord> list = new ArrayList();
	
	@Autowired
	private AttendanceRecordService attendanceRecordService;
	
	
	public Student getStudent() {
		return student;
	}
	public void setStudent(Student student) {
		this.student = student;
	}
	public List<StudentAttendanceRecord> getList() {
		return list;
	}
	public void setList(List<StudentAttendanceRecord> list) {
		this.list = list;
	}
	@Override
	public String execute() {
		
		result = attendanceRecordService.findAttendanceRecord(student,list);
		if (result.containsKey(Constant.SUCCESS)) {
			System.out.println("success");
			return SUCCESS;
		}
		return ERROR;
	}
}
